//
//
//  排料加工界面
//
//

import QtQuick
import QtQuick.Controls.Material
import QtQuick.Layouts



Item {
    id: orderProcessWindowRoot
    width: rootWidth
    // height: rootHeight /*- 150*/
    height: 1875

    property int currentPacket: Cpp_OrderProcess.packetNumber
    property string currentOrder: Cpp_PLC.OrderNumber_OrderProcess

    Component.onCompleted: {
        Cpp_PLC.QML_CurrentPage = 5;
        Cpp_PLC.write_Modbus_RTU_Hold_16(48,"3")
        write_Current_Page_Parameter_Into_PLC(0)
    }


    function  write_Current_Page_Parameter_Into_PLC(currentPacket)
    {
        if(Cpp_OrderProcess.LeftAngle_01 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1520,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1520,"1");
        }
        if(Cpp_OrderProcess.RightAngle_01 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1521,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1521,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1400,Cpp_OrderProcess.MaterialHeight_01);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_01);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1480,Cpp_OrderProcess.CutCount_01);

        if(Cpp_OrderProcess.LeftAngle_02 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1522,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1522,"1");
        }
        if(Cpp_OrderProcess.RightAngle_02 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1523,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1523,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1402,Cpp_OrderProcess.MaterialHeight_02);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1442,Cpp_OrderProcess.MaterialLength_02);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1481,Cpp_OrderProcess.CutCount_02);

        if(Cpp_OrderProcess.LeftAngle_03 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1524,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1524,"1");
        }
        if(Cpp_OrderProcess.RightAngle_03 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1525,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1525,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1404,Cpp_OrderProcess.MaterialHeight_03);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1444,Cpp_OrderProcess.MaterialLength_03);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1482,Cpp_OrderProcess.CutCount_03);

        if(Cpp_OrderProcess.LeftAngle_04 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1526,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1526,"1");
        }
        if(Cpp_OrderProcess.RightAngle_04 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1527,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1527,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1406,Cpp_OrderProcess.MaterialHeight_04);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1446,Cpp_OrderProcess.MaterialLength_04);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1483,Cpp_OrderProcess.CutCount_04);

        if(Cpp_OrderProcess.LeftAngle_05 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1528,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1528,"1");
        }
        if(Cpp_OrderProcess.RightAngle_05 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1529,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1529,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1408,Cpp_OrderProcess.MaterialHeight_05);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1448,Cpp_OrderProcess.MaterialLength_05);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1484,Cpp_OrderProcess.CutCount_05);

        if(Cpp_OrderProcess.LeftAngle_06 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1530,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1530,"1");
        }
        if(Cpp_OrderProcess.RightAngle_06 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1531,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1531,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1410,Cpp_OrderProcess.MaterialHeight_06);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1450,Cpp_OrderProcess.MaterialLength_06);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1485,Cpp_OrderProcess.CutCount_06);

        if(Cpp_OrderProcess.LeftAngle_07 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1532,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1532,"1");
        }
        if(Cpp_OrderProcess.RightAngle_07 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1533,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1533,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1412,Cpp_OrderProcess.MaterialHeight_07);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1452,Cpp_OrderProcess.MaterialLength_07);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1486,Cpp_OrderProcess.CutCount_07);

        if(Cpp_OrderProcess.LeftAngle_08 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1534,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1534,"1");
        }
        if(Cpp_OrderProcess.RightAngle_08 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1535,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1535,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1414,Cpp_OrderProcess.MaterialHeight_08);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1454,Cpp_OrderProcess.MaterialLength_08);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1487,Cpp_OrderProcess.CutCount_08);

        if(Cpp_OrderProcess.LeftAngle_09 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1536,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1536,"1");
        }
        if(Cpp_OrderProcess.RightAngle_09 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1537,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1537,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1416,Cpp_OrderProcess.MaterialHeight_09);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1456,Cpp_OrderProcess.MaterialLength_09);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1488,Cpp_OrderProcess.CutCount_09);

        if(Cpp_OrderProcess.LeftAngle_10 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1538,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1538,"1");
        }
        if(Cpp_OrderProcess.RightAngle_10 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1539,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1539,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1418,Cpp_OrderProcess.MaterialHeight_10);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1458,Cpp_OrderProcess.MaterialLength_10);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1489,Cpp_OrderProcess.CutCount_10);

        if(Cpp_OrderProcess.LeftAngle_11 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1540,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1540,"1");
        }
        if(Cpp_OrderProcess.RightAngle_11 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1541,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1541,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1420,Cpp_OrderProcess.MaterialHeight_11);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1460,Cpp_OrderProcess.MaterialLength_11);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1490,Cpp_OrderProcess.CutCount_11);

        if(Cpp_OrderProcess.LeftAngle_12 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1542,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1542,"1");
        }
        if(Cpp_OrderProcess.RightAngle_12 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1543,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1543,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1422,Cpp_OrderProcess.MaterialHeight_12);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1462,Cpp_OrderProcess.MaterialLength_12);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1491,Cpp_OrderProcess.CutCount_12);

        if(Cpp_OrderProcess.LeftAngle_13 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1544,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1544,"1");
        }
        if(Cpp_OrderProcess.RightAngle_13 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1545,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1545,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1424,Cpp_OrderProcess.MaterialHeight_13);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1464,Cpp_OrderProcess.MaterialLength_13);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1492,Cpp_OrderProcess.CutCount_13);

        if(Cpp_OrderProcess.LeftAngle_14 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1546,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1546,"1");
        }
        if(Cpp_OrderProcess.RightAngle_14 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1547,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1547,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1426,Cpp_OrderProcess.MaterialHeight_14);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1466,Cpp_OrderProcess.MaterialLength_14);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1493,Cpp_OrderProcess.CutCount_14);

        if(Cpp_OrderProcess.LeftAngle_15 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1548,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1548,"1");
        }
        if(Cpp_OrderProcess.RightAngle_15 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1549,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1549,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1428,Cpp_OrderProcess.MaterialHeight_15);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1468,Cpp_OrderProcess.MaterialLength_15);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1494,Cpp_OrderProcess.CutCount_15);

        if(Cpp_OrderProcess.LeftAngle_16 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1550,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1550,"1");
        }
        if(Cpp_OrderProcess.RightAngle_16 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1551,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1551,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1430,Cpp_OrderProcess.MaterialHeight_16);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1470,Cpp_OrderProcess.MaterialLength_16);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1495,Cpp_OrderProcess.CutCount_16);

        if(Cpp_OrderProcess.LeftAngle_17 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1552,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1552,"1");
        }
        if(Cpp_OrderProcess.RightAngle_17 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1553,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1553,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1432,Cpp_OrderProcess.MaterialHeight_17);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1472,Cpp_OrderProcess.MaterialLength_17);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1496,Cpp_OrderProcess.CutCount_17);

        if(Cpp_OrderProcess.LeftAngle_18 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1554,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1554,"1");
        }
        if(Cpp_OrderProcess.RightAngle_18 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1555,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1555,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1434,Cpp_OrderProcess.MaterialHeight_18);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1474,Cpp_OrderProcess.MaterialLength_18);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1497,Cpp_OrderProcess.CutCount_18);

        if(Cpp_OrderProcess.LeftAngle_19 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1556,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1556,"1");
        }
        if(Cpp_OrderProcess.RightAngle_19 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1557,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1557,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1436,Cpp_OrderProcess.MaterialHeight_19);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1476,Cpp_OrderProcess.MaterialLength_19);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1498,Cpp_OrderProcess.CutCount_19);

        if(Cpp_OrderProcess.LeftAngle_20 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1558,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1558,"1");
        }
        if(Cpp_OrderProcess.RightAngle_20 === "45")
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1559,"0");
        }
        else
        {
            Cpp_PLC.write_Modbus_RTU_Hold_16(1559,"1");
        }
        Cpp_PLC.write_Modbus_RTU_Hold_32(1438,Cpp_OrderProcess.MaterialHeight_20);
        Cpp_PLC.write_Modbus_RTU_Hold_32(1478,Cpp_OrderProcess.MaterialLength_20);
        Cpp_PLC.write_Modbus_RTU_Hold_16(1499,Cpp_OrderProcess.CutCount_20);

    }







    ColumnLayout{
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.top: parent.top
        spacing: 0

        Item{
            width: 1080
            height: 70

            Rectangle{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                width: 100
                height: 70
                radius: 10
                border.width: 1
                border.color: "white"
                color: "black"

                Text{
                    anchors.centerIn: parent
                    font.pixelSize:  Cpp_Config.Language_Type === 0 ? 30 :  Cpp_Config.Language_Type === 1 ? 20 : 20
                    font.bold: true
                    color: "white"
                    text: qsTr("序 号")
                }
            }
            Rectangle{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                width: 150
                height: 70
                radius: 10
                border.width: 1
                border.color: "white"
                color: "black"

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: Cpp_Config.Language_Type === 0 ? 30 :  Cpp_Config.Language_Type === 1 ? 20 : 20
                    font.bold: true
                    color: "white"
                    text: qsTr("左角度")
                }
            }
            Rectangle{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                width: 150
                height: 70
                radius: 10
                border.width: 1
                border.color: "white"
                color: "black"

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: Cpp_Config.Language_Type === 0 ? 30 :  Cpp_Config.Language_Type === 1 ? 20 : 20
                    font.bold: true
                    color: "white"
                    text: qsTr("右角度")
                }
            }
            Rectangle{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                width: 170
                height: 70
                radius: 10
                border.width: 1
                border.color: "white"
                color: "black"

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: Cpp_Config.Language_Type === 0 ? 30 :  Cpp_Config.Language_Type === 1 ? 20 : 20
                    font.bold: true
                    color: "white"
                    text: qsTr("高 度")
                }
            }
            Rectangle{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                width: 170
                height: 70
                radius: 10
                border.width: 1
                border.color: "white"
                color: "black"

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: Cpp_Config.Language_Type === 0 ? 30 :  Cpp_Config.Language_Type === 1 ? 20 : 20
                    font.bold: true
                    color: "white"
                    text: qsTr("长 度")
                }
            }
            Rectangle{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                width: 170
                height: 70
                radius: 10
                border.width: 1
                border.color: "white"
                color: "black"

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: Cpp_Config.Language_Type === 0 ? 30 :  Cpp_Config.Language_Type === 1 ? 20 : 20
                    font.bold: true
                    color: "white"
                    text: qsTr("切割数量")
                }
            }
            Rectangle{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                width: 170
                height: 70
                radius: 10
                border.width: 1
                border.color: "white"
                color: "black"

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: Cpp_Config.Language_Type === 0 ? 30 :  Cpp_Config.Language_Type === 1 ? 20 : 20
                    font.bold: true
                    color: "white"
                    text: qsTr("已加工数量")
                }

                MouseArea{
                    anchors.fill: parent

                    onPressed: {
                        Cpp_PLC.write_Modbus_RTU_Coils(142,"1")
                    }

                    onReleased: {
                        Cpp_PLC.write_Modbus_RTU_Coils(142,"0")
                    }
                }

            }

        }

        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_01
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "1"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }

            }

            A_Label{
                // id: leftAngle_01
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_01
                label_FontColor: label_Data === "90" ?  "red" /*: label_Data === "-45" ?  "orange"*/ : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_01 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+1),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1520,"1");
                        }
                        else if(Cpp_OrderProcess.LeftAngle_01 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+1),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1520,"0");
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_01 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+1),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_01 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+1),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                // id: rightAngle_01
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_01
                label_FontColor: label_Data === "90" ?  "red" /*: label_Data === "-45" ?  "orange" */: "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_01 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+1),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1521,"1");
                        }
                        else if(Cpp_OrderProcess.RightAngle_01 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+1),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1521,"0");
                        }
                        // else if(Cpp_OrderProcess.RightAngle_01 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+1),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_01 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+1),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                // id: materialHeight_01
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_01

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 1),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1400,Cpp_OrderProcess.MaterialHeight_01)
                }

            }
            A_TextInput{
                // id: materialLength_01
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_01

                onInputFinished: {


                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 1),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_01)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 1),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_01)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 1),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_01)
                    }

                }
            }
            A_TextInput{
                // id: cutCount_01
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_01

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 1),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1480,Cpp_OrderProcess.CutCount_01)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70
                showData: Cpp_PLC.WorkedCount_01_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1500,inputData)
                }

            }

            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_01.focus ? true : false
            // }

        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_02
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "2"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                // id: leftAngle_02
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_02
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_02 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+2),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1522,"1");
                        }
                        else if(Cpp_OrderProcess.LeftAngle_02 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+2),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1522,"0");
                        }
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+2),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_02 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+2),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                // id: rightAngle_02
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_02
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_02 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+2),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1523,"1");
                        }
                        else if(Cpp_OrderProcess.RightAngle_02 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+2),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1523,"0");
                        }
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+2),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_02 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+2),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                // id: materialHeight_02
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_02

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 2),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1402,Cpp_OrderProcess.MaterialHeight_02);
                }

            }
            A_TextInput{
                // id: materialLength_02
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_02

                onInputFinished: {                    

                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 2),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_02)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 2),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_02)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 2),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1442,Cpp_OrderProcess.MaterialLength_02)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_02

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 2),"CutCount",inputData)                    
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1481,Cpp_OrderProcess.CutCount_02)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_02_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1501,inputData)
                }
            }

            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_02.focus ? true : false
            // }

        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id : order_03
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "3"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_03
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_03 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+3),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1524,"1")
                        }
                        else if(Cpp_OrderProcess.LeftAngle_03 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+3),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1524,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_03 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+3),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_03 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+3),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_03
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_03 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+3),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1525,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_03 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+3),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1525,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_03 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+3),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_03 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+3),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_03

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 3),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1404,Cpp_OrderProcess.MaterialHeight_03)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_03

                onInputFinished: {


                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 3),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_03)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 3),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_03)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 3),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1444,Cpp_OrderProcess.MaterialLength_03)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_03

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 3),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1482,Cpp_OrderProcess.CutCount_03)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_03_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1502,inputData)
                }
            }

            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_03.focus ? true : false
            // }

        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id : order_04
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "4"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_04
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_04 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+4),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1526,"1")
                        }
                        else if(Cpp_OrderProcess.LeftAngle_04 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+4),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1527,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_04 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+4),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_04 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+4),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_04
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_04 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+4),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1527,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_04 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+4),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1527,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_04 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+4),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_04 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+4),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_04

                onInputFinished: {                    
                    Cpp_OrderProcess.saveData((currentPacket*20 + 4),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1406,Cpp_OrderProcess.MaterialHeight_04)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_04

                onInputFinished: {                                        

                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 4),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_04)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 4),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_04)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 4),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1446,Cpp_OrderProcess.MaterialLength_04)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_04

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 4),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1483,Cpp_OrderProcess.CutCount_04)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_04_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1503,inputData)
                }
            }

            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_04.focus ? true : false
            // }

        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_05
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "5"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_05
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_05 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+5),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1528,"1")
                        }
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+5),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1528,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_05 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+5),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_05 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+5),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_05
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_05 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+5),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1529,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_05 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+5),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1529,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_05 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+5),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_05 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+5),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_05

                onInputFinished: {                    
                    Cpp_OrderProcess.saveData((currentPacket*20 + 5),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1408,Cpp_OrderProcess.MaterialHeight_05)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_05

                onInputFinished: {

                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 5),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_05)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 5),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_05)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 5),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1448,Cpp_OrderProcess.MaterialLength_05)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_05

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 5),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1484,Cpp_OrderProcess.CutCount_05)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_05_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1504,inputData)
                }
            }

            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_05.focus ? true : false
            // }
        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_06
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "6"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_06
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_06 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+6),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1530,"1")
                        }
                        else if(Cpp_OrderProcess.LeftAngle_06 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+6),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1530,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_06 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+6),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_06 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+6),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_06
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_06 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+6),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1531,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_06 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+6),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1531,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_06 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+6),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_06 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+6),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_06

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 6),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1410,Cpp_OrderProcess.MaterialHeight_06)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_06

                onInputFinished: {


                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 6),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_06)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 6),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_06)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 6),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1450,Cpp_OrderProcess.MaterialLength_06)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_06

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 6),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1485,Cpp_OrderProcess.CutCount_06)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_06_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1505,inputData)
                }
            }

            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_06.focus ? true : false
            // }

        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_07
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "7"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_07
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_07 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+7),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1532,"1")
                        }
                        else if(Cpp_OrderProcess.LeftAngle_07 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+7),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1532,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_07 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+7),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_07 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+7),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_07
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_07 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+7),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1533,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_07 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+7),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1533,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_07 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+7),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_07 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+7),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_07

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 7),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1412,Cpp_OrderProcess.MaterialHeight_07)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_07

                onInputFinished: {                    

                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 7),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_07)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 7),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_07)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 7),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1452,Cpp_OrderProcess.MaterialLength_07)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_07

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 7),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1486,Cpp_OrderProcess.CutCount_07)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_07_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1506,inputData)
                }
            }

            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_07.focus ? true : false
            // }

        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_08
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "8"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_08
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_08 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+8),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1534,"1")
                        }
                        else if(Cpp_OrderProcess.LeftAngle_08 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+8),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1534,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_08 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+8),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_08 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+8),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_08
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_08 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+8),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1535,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_08 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+8),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1535,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_08 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+8),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_08 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+8),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_08

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 8),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1414,Cpp_OrderProcess.MaterialHeight_08)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_08

                onInputFinished: {                    

                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 8),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_08)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 8),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_08)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 8),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1454,Cpp_OrderProcess.MaterialLength_08)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_08

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 8),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1487,Cpp_OrderProcess.CutCount_08)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_08_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1507,inputData)
                }
            }

            Rectangle{
                anchors.fill: parent
                color: "gold"
                opacity: 0.3
                visible: order_08.focus ? true : false
            }

        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_09
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "9"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_09
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_09 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+9),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1536,"1")
                        }
                        else if(Cpp_OrderProcess.LeftAngle_09 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+9),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1536,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_09 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+9),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_09 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+9),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_09
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_09 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+9),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1537,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_09 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+9),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1537,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_09 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+9),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_09 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+9),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_09

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 9),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1416,Cpp_OrderProcess.MaterialHeight_09)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_09

                onInputFinished: {                    

                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 9),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_09)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 9),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_09)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 9),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1456,Cpp_OrderProcess.MaterialLength_09)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_09

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 9),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1488,Cpp_OrderProcess.CutCount_09)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_09_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1508,inputData)
                }
            }

            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_09.focus ? true : false
            // }

        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_10
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "10"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_10
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_10 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+10),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1538,"1")
                        }
                        else if(Cpp_OrderProcess.LeftAngle_10 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+10),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1538,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_10 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+10),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_10 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+10),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_10
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_10 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+10),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1539,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_10 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+10),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1539,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_10 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+10),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_10 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+10),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_10

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 10),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1418,Cpp_OrderProcess.MaterialHeight_10)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_10

                onInputFinished: {

                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 10),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_10)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 10),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_10)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 10),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1458,Cpp_OrderProcess.MaterialLength_10)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_10

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 10),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1489,Cpp_OrderProcess.CutCount_10)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_10_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1509,inputData)
                }
            }

            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_10.focus ? true : false
            // }

        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_11
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "11"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_11
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_11 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+11),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1540,"1")
                        }
                        else if(Cpp_OrderProcess.LeftAngle_11 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+11),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1540,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_11 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+11),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_11 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+11),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_11
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_11 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+11),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1541,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_11 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+11),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1541,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_11 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+11),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_11 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+11),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_11

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 11),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1420,Cpp_OrderProcess.MaterialHeight_11)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_11

                onInputFinished: {                    

                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 11),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_11)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 11),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_11)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 11),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1460,Cpp_OrderProcess.MaterialLength_11)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_11

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 11),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1490,Cpp_OrderProcess.CutCount_11)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_11_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1510,inputData)
                }
            }

            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_11.focus ? true : false
            // }

        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_12
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "12"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_12
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_12 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+12),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1542,"1")
                        }
                        else if(Cpp_OrderProcess.LeftAngle_12 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+12),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1542,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_12 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+12),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_12 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+12),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_12
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_12 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+12),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1543,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_12 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+12),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1543,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_12 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+12),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_12 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+12),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_12

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 12),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1422,Cpp_OrderProcess.MaterialHeight_12)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_12

                onInputFinished: {                    

                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 12),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_12)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 12),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_12)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 12),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1462,Cpp_OrderProcess.MaterialLength_12)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_12

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 12),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1491,Cpp_OrderProcess.CutCount_12)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_12_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1511,inputData)
                }
            }

            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_12.focus ? true : false
            // }

        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_13
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "13"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_13
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_13 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+13),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1544,"1")
                        }
                        else if(Cpp_OrderProcess.LeftAngle_13 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+13),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1544,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_13 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+13),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_13 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+13),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_13
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_13 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+13),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1545,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_13 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+13),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1545,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_13 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+13),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_13 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+13),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_13

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 13),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1424,Cpp_OrderProcess.MaterialHeight_13)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_13

                onInputFinished: {

                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 13),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_13)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 13),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_13)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 13),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1464,Cpp_OrderProcess.MaterialLength_13)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_13

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 13),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1492,Cpp_OrderProcess.CutCount_13)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_13_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1512,inputData)
                }
            }

            Rectangle{
                anchors.fill: parent
                color: "gold"
                opacity: 0.3
                visible: order_13.focus ? true : false
            }

        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_14
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "14"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_14
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_14 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+14),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1546,"1")
                        }
                        else if(Cpp_OrderProcess.LeftAngle_14 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+14),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1546,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_14 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+14),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_14 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+14),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_14
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_14 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+14),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1547,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_14 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+14),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1547,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_14 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+14),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_14 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+14),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_14

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 14),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1426,Cpp_OrderProcess.MaterialHeight_14)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_14

                onInputFinished: {                    

                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 14),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_14)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 14),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_14)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 14),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1466,Cpp_OrderProcess.MaterialLength_14)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_14

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 14),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1493,Cpp_OrderProcess.CutCount_14)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_14_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1513,inputData)
                }
            }

            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_14.focus ? true : false
            // }

        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_15
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "15"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_15
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_15 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+15),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1548,"1")
                        }
                        else if(Cpp_OrderProcess.LeftAngle_15 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+15),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1548,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_15 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+15),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_15 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+15),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_15
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_15 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+15),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1549,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_15 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+15),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1549,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_15 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+15),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_15 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+15),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_15

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 15),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1428,Cpp_OrderProcess.MaterialHeight_15)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_15

                onInputFinished: {                    

                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 15),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_15)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 15),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_15)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 15),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1468,Cpp_OrderProcess.MaterialLength_15)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_15

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 15),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1494,Cpp_OrderProcess.CutCount_15)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_15_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1514,inputData)
                }
            }

            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_15.focus ? true : false
            // }
        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_16
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "16"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_16
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_16 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+16),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1550,"1")
                        }
                        else if(Cpp_OrderProcess.LeftAngle_16 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+16),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1550,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_16 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+16),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_16 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+16),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_16
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_16 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+16),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1551,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_16 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+16),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1551,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_16 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+16),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_16 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+16),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_16

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 16),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1430,Cpp_OrderProcess.MaterialHeight_16)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_16

                onInputFinished: {                    

                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 16),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_16)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 16),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_16)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 16),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1470,Cpp_OrderProcess.MaterialLength_16)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_16

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 16),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1495,Cpp_OrderProcess.CutCount_16)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_16_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1515,inputData)
                }
            }

            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_16.focus ? true : false
            // }

        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_17
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "17"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_17
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_17 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+17),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1552,"1")
                        }
                        else if(Cpp_OrderProcess.LeftAngle_17 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+17),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1552,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_17 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+17),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_17 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+17),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_17
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_17 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+17),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1553,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_17 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+17),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1553,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_17 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+17),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_17 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+17),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_17

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 17),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1432,Cpp_OrderProcess.MaterialHeight_17)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_17

                onInputFinished: {

                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 17),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_17)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 17),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_17)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 17),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1472,Cpp_OrderProcess.MaterialLength_17)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_17

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 17),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1496,Cpp_OrderProcess.CutCount_17)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_17_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1516,inputData)
                }
            }

            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_17.focus ? true : false
            // }

        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_18
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "18"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_18
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_18 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+18),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1554,"1")
                        }
                        else if(Cpp_OrderProcess.LeftAngle_18 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+18),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1554,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_18 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+18),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_18 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+18),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_18
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_18 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+18),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1555,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_18 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+18),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1555,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_18 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+18),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_18 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+18),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_18

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 18),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1434,Cpp_OrderProcess.MaterialHeight_18)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_18

                onInputFinished: {                    

                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 18),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_18)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 18),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_18)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 18),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1474,Cpp_OrderProcess.MaterialLength_18)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_18

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 18),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1497,Cpp_OrderProcess.CutCount_18)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_18_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1517,inputData)
                }
            }


            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_18.focus ? true : false
            // }
        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_19
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "19"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_19
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_19 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+19),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1556,"1")
                        }
                        else if(Cpp_OrderProcess.LeftAngle_19 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+19),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1556,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_19 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+19),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_19 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+19),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_19
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_19 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+19),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1557,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_19 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+19),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1557,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_19 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+19),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_19 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+19),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_19

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 19),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1436,Cpp_OrderProcess.MaterialHeight_19)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_19

                onInputFinished: {                                       

                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 19),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_19)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 19),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_19)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 19),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1476,Cpp_OrderProcess.MaterialLength_19)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_19

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 19),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1498,Cpp_OrderProcess.CutCount_19)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_19_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1518,inputData)
                }
            }

            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_19.focus ? true : false
            // }

        }
        Item{
            width: 1078
            height: 70

            A_Label{
                id: order_20
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                labelWidth: 100
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                // labelBack: "white"
                labelBack: currentOrder === label_Data ? "green" : "white"
                label_Data: "20"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        parent.forceActiveFocus()
                        Cpp_PLC.write_Modbus_RTU_Hold_16(76,parent.label_Data)
                        // Cpp_PLC.write_Modbus_RTU_Coils(172,0)
                        if(Cpp_PLC.MechineChangeAngleMode)
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                        }
                        else
                        {
                            Cpp_PLC.write_Modbus_RTU_Coils(140,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,1)
                            Cpp_PLC.write_Modbus_RTU_Coils(140,0)
                            Cpp_PLC.write_Modbus_RTU_Coils(141,0)
                        }
                    }

                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.LeftAngle_20
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.LeftAngle_20 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+20),"LeftAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1558,"1")
                        }
                        else if(Cpp_OrderProcess.LeftAngle_20 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+20),"LeftAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1558,"0")
                        }
                        // else if(Cpp_OrderProcess.LeftAngle_20 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+20),"LeftAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.LeftAngle_20 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+20),"LeftAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }

            A_Label{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 250
                labelWidth: 150
                labelHeight: 70
                labelBorderColor: "black"
                labelBorderWidth: 1
                labelBack: "white"
                label_Data: Cpp_OrderProcess.RightAngle_20
                label_FontColor: label_Data === "90" ?  "red" : label_Data === "-45" ?  "orange" : "black"

                MouseArea{
                    anchors.fill: parent

                    onClicked: {
                        if(Cpp_OrderProcess.RightAngle_20 === "45")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+20),"RightAngle","90")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1559,"1")
                        }
                        else if(Cpp_OrderProcess.RightAngle_20 === "90")
                        {
                            Cpp_OrderProcess.saveData((currentPacket*20+20),"RightAngle","45")
                            Cpp_PLC.write_Modbus_RTU_Hold_16(1559,"0")
                        }
                        // else if(Cpp_OrderProcess.RightAngle_20 === "90")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+20),"RightAngle","-45")
                        // }
                        // else if(Cpp_OrderProcess.RightAngle_20 === "-45")
                        // {
                        //     Cpp_OrderProcess.saveData((currentPacket*20+20),"RightAngle","45")
                        // }

                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                    }
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 400
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialHeight_20

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 20),"MaterialHeight",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_32(1438,Cpp_OrderProcess.MaterialHeight_20)
                }

            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 570
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_OrderProcess.MaterialLength_20

                onInputFinished: {                    

                    if(Number(inputData) < Number(Cpp_PLC.ExtraShort_MaterialLengthMin))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 20),"MaterialLength",Cpp_PLC.ExtraShort_MaterialLengthMin)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_20)
                    }
                    else if(Number(inputData) > Number(Cpp_PLC.ExtraLong_MaterialLengthMax))
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 20),"MaterialLength",Cpp_PLC.ExtraLong_MaterialLengthMax)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1440,Cpp_OrderProcess.MaterialLength_20)
                    }
                    else
                    {
                        Cpp_OrderProcess.saveData((currentPacket*20 + 20),"MaterialLength",inputData)
                        Cpp_OrderProcess.getDataByPacket(currentPacket)
                        Cpp_PLC.write_Modbus_RTU_Hold_32(1478,Cpp_OrderProcess.MaterialLength_20)
                    }

                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 740
                inputWidth: 170
                inputHeight: 70

                showData:Cpp_OrderProcess.CutCount_20

                onInputFinished: {
                    Cpp_OrderProcess.saveData((currentPacket*20 + 20),"CutCount",inputData)
                    Cpp_OrderProcess.getDataByPacket(currentPacket)
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1499,Cpp_OrderProcess.CutCount_20)
                }
            }
            A_TextInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 910
                inputWidth: 170
                inputHeight: 70

                showData: Cpp_PLC.WorkedCount_20_OrderProcess

                onInputFinished: {
                    Cpp_PLC.write_Modbus_RTU_Hold_16(1519,inputData)
                }
            }

            // Rectangle{
            //     anchors.fill: parent
            //     color: "gold"
            //     opacity: 0.3
            //     visible: order_20.focus ? true : false
            // }

        }

    }

    // 页码

    PageIndicator{
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.bottom: parent.bottom
        anchors.bottomMargin: 350
        count: 20
        interactive: true
        currentIndex: currentPacket
        onCurrentIndexChanged:{
            currentPacket = currentIndex
            console.log(Cpp_OrderProcess.packetNumber)
            Cpp_OrderProcess.getDataByPacket(currentPacket)
            write_Current_Page_Parameter_Into_PLC(currentPacket)
        }

        delegate: Rectangle{
            width: 40
            height: 40
            radius: 10
            gradient: pressed ? pressedColor : index === currentPacket ? currentColor : defaultColor

            property var pressedColor : Gradient {
                orientation: Gradient.Vertical
                GradientStop { position: 0.0 ; color: "#FFFFFF"}
                GradientStop { position: 0.5 ; color: "gold"}
                GradientStop { position: 1.0 ; color: "#FFFFFF"}
            }

            property var defaultColor : Gradient {
                orientation: Gradient.Vertical
                GradientStop { position: 0.0 ; color: "#FFFFFF"}
                GradientStop { position: 0.5 ; color: "#1E90FF"}
                GradientStop { position: 1.0 ; color: "#FFFFFF"}
            }

            property var currentColor : Gradient {
                orientation: Gradient.Vertical
                GradientStop { position: 0.0 ; color: "#DB7093"}
                GradientStop { position: 1.0 ; color: "#FFFFFF"}
            }


            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                color: "black"
                text: (index + 1)

            }
        }

    }

    Item{
        anchors.left: orderProcessWindowRoot.left
        anchors.bottom: orderProcessWindowRoot.bottom
        anchors.bottomMargin: 110
        width: 280
        height: 220

        A_Button{
            anchors.top: parent.top
            anchors.horizontalCenter: parent.horizontalCenter
            buttonWidth: 200
            buttonHeight: 60
            contentText_Data: qsTr("左锯出锯")
            // contentText_Fontsize: 30
            contentText_Bold: false
            contentRectangle_BorderWidth: Cpp_PLC.SawsMode === "1" ? 5 : 3
            contentRectangle_BorderColor: Cpp_PLC.SawsMode === "1" ? "gold" : "black"

            onButtonClicked: {
                // console.log("左锯片出锯")
                Cpp_PLC.write_Modbus_RTU_Hold_16(229,"1")
            }

        }

        A_Button{
            anchors.top: parent.top
            anchors.topMargin: 80
            anchors.horizontalCenter: parent.horizontalCenter
            buttonWidth: 200
            buttonHeight: 60
            contentText_Data: qsTr("左右联动")
            // contentText_Fontsize: 30
            contentText_Bold: false
            contentRectangle_BorderWidth: Cpp_PLC.SawsMode === "0" ? 5 : 3
            contentRectangle_BorderColor: Cpp_PLC.SawsMode === "0" ? "gold" : "black"

            onButtonClicked: {
                // console.log("联动出锯")
                Cpp_PLC.write_Modbus_RTU_Hold_16(229,"0")
            }

        }

        A_Button{
            anchors.top: parent.top
            anchors.topMargin: 160
            anchors.horizontalCenter: parent.horizontalCenter
            buttonWidth: 200
            buttonHeight: 60
            contentText_Data: qsTr("右锯出锯")
            // contentText_Fontsize: 30
            contentText_Bold: false
            contentRectangle_BorderWidth: Cpp_PLC.SawsMode === "2" ? 5 : 3
            contentRectangle_BorderColor: Cpp_PLC.SawsMode === "2" ? "gold" : "black"

            onButtonClicked: {
                // console.log("右锯片出锯")
                Cpp_PLC.write_Modbus_RTU_Hold_16(229,"2")
            }

        }

    }

    A_Button{
        anchors.right: orderProcessWindowRoot.right
        anchors.rightMargin: 30
        anchors.bottom: orderProcessWindowRoot.bottom
        anchors.bottomMargin: 110
        contentText_Data: qsTr("清除数据")

        onButtonClicked: {
            Cpp_OrderProcess.cleanAllData(currentPacket)
            write_Current_Page_Parameter_Into_PLC(currentPacket)
        }

    }

    Text{
        anchors.right: orderProcessWindowRoot.right
        anchors.rightMargin: 250
        anchors.bottom: orderProcessWindowRoot.bottom
        anchors.bottomMargin: 200
        font.pixelSize: 30
        font.bold: true
        // visible: false
        text: qsTr("循环进行中!!")
        color: "red"
        visible: Cpp_PLC.Circle_Runing_State === "1" ? true : false
    }

    A_Button{
        anchors.right: orderProcessWindowRoot.right
        anchors.rightMargin: 30
        anchors.bottom: orderProcessWindowRoot.bottom
        anchors.bottomMargin: 200
        contentText_Data: qsTr("循环演示")
        contentRectangle_BorderWidth: Cpp_PLC.Circle_Mode === "1" ? 5 : 3
        contentRectangle_BorderColor: Cpp_PLC.Circle_Mode === "1" ? "gold" : "black"
        // visible: false

        onButtonClicked: {
            if(Cpp_PLC.Circle_Mode === "0")
            {
                Cpp_PLC.write_Modbus_RTU_Coils(259,"1")
            }
            else
            {
                Cpp_PLC.write_Modbus_RTU_Coils(259,"0")
            }

        }

    }

    A_Button{
        anchors.right: orderProcessWindowRoot.right
        anchors.rightMargin: 380
        // anchors.verticalCenter: orderProcessWindowRoot.verticalCenter
        anchors.bottom: orderProcessWindowRoot.bottom
        anchors.bottomMargin: 200
        buttonWidth: 150
        buttonHeight: 90
        contentText_Data: Cpp_PLC.SawsStartState ? qsTr("锯  启") : qsTr("锯  停")
        // contentText_Fontsize:  Cpp_Config.Language_Type === 1 ? 35 :  Cpp_Config.Language_Type === 2 ? 20 : 20
        contentRectangle_BorderWidth: Cpp_PLC.SawsStartState ? 5 : 3
        contentRectangle_BorderColor: Cpp_PLC.SawsStartState ? "gold" : "black"

        onButtonPressed: {
            // console.log("锯片按下")
            Cpp_PLC.write_Modbus_RTU_Coils(237,"1")
        }

        onButtonReleased: {
            // console.log("锯片松开")
            Cpp_PLC.write_Modbus_RTU_Coils(237,"0")
        }
    }


}


